import { createApp } from 'vue'
import App from './App.vue'
import {
    Dialog,
    Toast,
    Picker,
    Field,
    CellGroup,
    Form,
    Uploader,
    Overlay,
    Icon,
    Popup,
    Checkbox,
    Area,
    Search,
    Cell,
    List,
    Empty,
    PullRefresh,
    DatetimePicker,
    Swipe,
    SwipeItem,
    Calendar,
} from 'vant'
import { areaList } from '@vant/area-data'
import router from "./router"
import axios from "axios";
import { v4 as uuidv4 } from 'uuid';
import {message, Modal} from "ant-design-vue";
import 'ant-design-vue/dist/antd.css';
import 'ant-design-vue/dist/antd.css';
window.uuidv4 = uuidv4;

import 'vant/lib/index.css'
import './index.css'

const app = createApp(App)

// const baseUrl = 'http://ymicsi.natappfree.cc/';
// const baseUrl = 'http://1.117.94.134:8088/';
const baseUrl = 'http://localhost:8088/';

// 设置axios的基本URL
// axios.defaults.baseURL = 'http://localhost:8088/api';
// apiURL
// app.provide('$apiUrl', 'http://1.117.94.134:8088/api');
app.provide('$baseUrl', baseUrl  + 'api')
app.provide('$apiUrl', baseUrl + 'api');
// app.provide('$apiUrl', 'http://127.0.0.1:8088/api');
// 头像URL
// app.provide('$headImgUrl' , 'http://g9nrfz.natappfree.cc/');
app.provide('$headImgUrl' , baseUrl  + 'img');
app.component(Modal.name, Modal);
app.config.globalProperties.$message = message;
app.config.globalProperties.$error = Modal.error;
app.config.globalProperties.$warning = Modal.warning;
// 将Axios添加到全局Vue实例中
app.config.globalProperties.$http = axios;

app.use(router)
app.use(Picker)
app.use(Dialog)
app.use(Toast)
app.use(Field)
app.use(CellGroup)
app.use(Form)
app.use(Uploader)
app.use(Overlay)
app.use(Checkbox)
app.use(Popup)
app.use(Icon)
app.use(Area)
app.use(Search)
app.use(Cell)
app.use(List)
app.use(Empty)
app.use(PullRefresh)
app.use(DatetimePicker)
app.use(Swipe)
app.use(SwipeItem)
app.use(Calendar)
app.mount('#app')
